package cn.dm.controller;

import cn.dm.dto.Dto;
import cn.dm.dto.DtoUtil;
import cn.dm.service.LocalUserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/api")
public class UserLoginController {
    @Resource
    private LocalUserService localUserService;

    @RequestMapping(value = "/getLogin",method = RequestMethod.POST)
    public Dto Login(@RequestParam("phone") String phone,@RequestParam("password") String password)throws Exception{
        return localUserService.userLogin(phone,password);
    }
    @RequestMapping(value = "/OutLogin",method = RequestMethod.POST)
    public Dto removeToken(String token)throws Exception{
        return localUserService.removeToken(token);
    }
}
